package com.sdruixinggroup.mondayb2b.adapter;

import android.graphics.Color;
import android.view.View;
import android.widget.TextView;

import com.sdruixinggroup.mondayb2b.R;
import com.sdruixinggroup.mondayb2b.models.Province;

/**
 * Created by 00029935 on 2017/1/24.
 */

public class AreaAdapter extends QuickAdapter<Province.RegionsBean> {
    @Override
    public int getLayoutID(int viewType) {
        return R.layout.area_item;
    }

    @Override
    public void convert(VH holder, Province.RegionsBean itemData, int position) {
        ((TextView)holder.getView(R.id.tv_area)).setText(itemData.getName());
        View  view = holder.getView(R.id.rl_back);

        if(itemData.isSelector){
            holder.getView(R.id.iv_checked).setVisibility(View.VISIBLE);
            view.setBackgroundColor(0xffF1F1F1);
        }else {
            holder.getView(R.id.iv_checked).setVisibility(View.GONE);
            view.setBackgroundColor(Color.WHITE);
        }

    }


}
